import java.util.Scanner;

public class demo03 {
    //时间显示
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        long n=sc.nextLong();
        n/=1000;
        n%=24*60*60;
        long hour=n/(60*60);
        String hour1=hour+"";
        if(hour1.length()==1){
            hour1="0"+hour1;
        }
        n%=60*60;
        long min=n/60;
        String min1=min+"";
        if(min1.length()==1){
            min1="0"+min1;
        }
        long s=n%60;
        String s1=s+"";
        if(s1.length()==1){
            s1="0"+s1;
        }
        System.out.println(hour1+":"+min1+":"+s1);
    }
}
